<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes"/>

<xsl:include href="templates.xsl" />
<xsl:include href="preferences.xsl"/>
<xsl:include href="index-options.xsl"/>
<xsl:include href="detail-options.xsl"/>


<xsl:include href="!Index Pages/index-tv-1.xsl"/>
<xsl:include href="!Index Pages/index-normal-1.xsl"/>
<xsl:include href="!Index Pages/index-normal-1-options.xsl"/>
<xsl:include href="!Index Pages/index-normal-2.xsl"/>
<xsl:include href="!Index Pages/index-normal-2-options.xsl"/>
<xsl:include href="!Index Pages/index-set-1.xsl"/>
<xsl:include href="!Index Pages/index-normal-3.xsl"/>
<xsl:include href="!Index Pages/index-normal-4.xsl"/>

<xsl:variable name="mcounts" select="count(library/movies/movie)"/>
<xsl:variable name="smallPosterWidth">152</xsl:variable>
<xsl:variable name="smallPosterHeight">215</xsl:variable>
<xsl:variable name="file-container"><xsl:call-template name="substring-after-last"><xsl:with-param name="string" select="library/movies/movie[position()=1]/files/file[1]/fileURL" /><xsl:with-param name="delimiter" select="'.'" /></xsl:call-template></xsl:variable>


<xsl:variable name="currentIndex" select="//index[@current='true']/@currentIndex"/>
<xsl:variable name="lastIndex" select="//index[@current='true']/@lastIndex"/>
<xsl:variable name="nbCols" select="//@cols"/>
<xsl:variable name="nbLines" select="ceiling(count(library/movies/movie) div $nbCols)"/>
<xsl:template match="/">
<xsl:variable name="currentIndex" select="//index[@current='true']/@currentIndex"/>
<xsl:variable name="lastIndex" select="//index[@current='true']/@lastIndex"/>
 

<html>
<head>
<link rel="StyleSheet" type="text/css" href="exportindex_item_pch.css"></link>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>



<!--*************************************************Start of redefined TV scripts*******************************************-->


<xsl:choose>
	<xsl:when test="//index[@current='true']/@name ='TV Shows'[$tvshow-index='banner'] or library/category[@current='true'][@name='Set'][//library/movies/movie[position()=1]/season !='-1'][$tvshow-index='banner']">
		<xsl:call-template name="tv-index-1-style-and-script"></xsl:call-template>
	</xsl:when>
<xsl:otherwise>
<xsl:choose>
	<xsl:when test="//index[@current='true']/@name ='TV Shows'[$tvshow-index='index2'] or library/category[@current='true'][@name='Set'][//library/movies/movie[position()=1]/season !='-1'][$tvshow-index='index2']">
		<xsl:call-template name="index-2-style-and-script"></xsl:call-template>
	</xsl:when>
<xsl:otherwise>
<xsl:choose>
	<xsl:when test="//index[@current='true']/@name ='TV Shows'[$tvshow-index='index1'] or library/category[@current='true'][@name='Set'][//library/movies/movie[position()=1]/season !='-1'][$tvshow-index='index1']">
		<xsl:call-template name="index-1-style-and-script"></xsl:call-template>
	</xsl:when>
<xsl:otherwise>
<xsl:choose>
	<xsl:when test="//index[@current='true']/@name ='Set'[$set-index='set'] or library/category[@current='true'][@name='Set'][//library/movies/movie[position()=1]/season ='-1'][$set-index='set']">
		<xsl:call-template name="set-index-style-and-script"></xsl:call-template>
	</xsl:when>
<xsl:otherwise>
<xsl:choose>
	<xsl:when test="//index[@current='true']/@name ='Set'[$set-index='index1'] or library/category[@current='true'][@name='Set'][//library/movies/movie[position()=1]/season ='-1'][$set-index='index1']">
		<xsl:call-template name="index-1-style-and-script"></xsl:call-template>
	</xsl:when>
<xsl:otherwise>
<xsl:choose>
	<xsl:when test="//index[@current='true']/@name ='Set'[$set-index='index2'] or library/category[@current='true'][@name='Set'][//library/movies/movie[position()=1]/season ='-1'][$set-index='index2']">
		<xsl:call-template name="index-2-style-and-script"></xsl:call-template>
	</xsl:when>
<xsl:otherwise>
	<xsl:if test="$use-index='index4'">
		<xsl:call-template name="index-4-style-and-script"></xsl:call-template>
	</xsl:if>
	<xsl:if test="$use-index='index3'">
		<xsl:call-template name="index-3-style-and-script"></xsl:call-template>
	</xsl:if>
	<xsl:if test="$use-index='index2'">
		<xsl:call-template name="index-2-style-and-script"></xsl:call-template>
	</xsl:if>
	<xsl:if test="$use-index='index1'">
		<xsl:call-template name="index-1-style-and-script"></xsl:call-template>
	</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<!--***********************************************************END OF NORMAL INDEX*****************************************************************************-->



</head>

<body bgproperties="fixed" onloadset="movies4" onload="initpage()">

<xsl:attribute name="focuscolor">
	<xsl:choose>
		<xsl:when test="$use-index='index4'">#FFFFFF</xsl:when>
		<xsl:otherwise>transparent</xsl:otherwise>
	</xsl:choose>
</xsl:attribute>

<xsl:attribute name="focustext">
	<xsl:choose>
		<xsl:when test="$use-index='index4'">#000000</xsl:when>
		<xsl:otherwise>#FFFFFF</xsl:otherwise>
	</xsl:choose>
</xsl:attribute>



<!--*********************************************START OF INDEX HTML*****************************************************-->

<xsl:choose>
	<xsl:when test="//index[@current='true']/@name ='TV Shows'[$tvshow-index='banner'] or library/category[@current='true'][@name='Set'][//library/movies/movie[position()=1]/season !='-1'][$tvshow-index='banner']">
		<xsl:call-template name="tv-index-html"></xsl:call-template>
	</xsl:when>
<xsl:otherwise>
<xsl:choose>
	<xsl:when test="//index[@current='true']/@name ='TV Shows'[$tvshow-index='index2'] or library/category[@current='true'][@name='Set'][//library/movies/movie[position()=1]/season !='-1'][$tvshow-index='index2']">
		<xsl:call-template name="index-2-html"></xsl:call-template>
	</xsl:when>
<xsl:otherwise>
<xsl:choose>
	<xsl:when test="//index[@current='true']/@name ='TV Shows'[$tvshow-index='index1'] or library/category[@current='true'][@name='Set'][//library/movies/movie[position()=1]/season !='-1'][$tvshow-index='index1']">
		<xsl:call-template name="index-1-html"></xsl:call-template>
	</xsl:when>
<xsl:otherwise>
<xsl:choose>
	<xsl:when test="//index[@current='true']/@name ='Set'[$set-index='set'] or library/category[@current='true'][@name='Set'][//library/movies/movie[position()=1]/season ='-1'][$set-index='set']">
		<xsl:call-template name="set-index-html"></xsl:call-template>
	</xsl:when>
<xsl:otherwise>
<xsl:choose>
	<xsl:when test="//index[@current='true']/@name ='Set'[$set-index='index1'] or library/category[@current='true'][@name='Set'][//library/movies/movie[position()=1]/season ='-1'][$set-index='index1']">
		<xsl:call-template name="index-1-html"></xsl:call-template>
	</xsl:when>
<xsl:otherwise>
<xsl:choose>
	<xsl:when test="//index[@current='true']/@name ='Set'[$set-index='index2'] or library/category[@current='true'][@name='Set'][//library/movies/movie[position()=1]/season ='-1'][$set-index='index2']">
		<xsl:call-template name="index-2-html"></xsl:call-template>
	</xsl:when>
<xsl:otherwise>
	<xsl:if test="$use-index='index4'">
		<xsl:call-template name="index-4-html"></xsl:call-template>
	</xsl:if>
	<xsl:if test="$use-index='index3'">
		<xsl:call-template name="index-3-html"></xsl:call-template>
	</xsl:if>
	<xsl:if test="$use-index='index2'">
		<xsl:call-template name="index-2-html"></xsl:call-template>
	</xsl:if>
	<xsl:if test="$use-index='index1'">
		<xsl:call-template name="index-1-html"></xsl:call-template>
	</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>


<!--*********************************************END of HTML************************************************************-->
</body>
</html>

</xsl:template>


</xsl:stylesheet>
